﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="BackTestProviderForm.cs" company="">
//   
// </copyright>
// <summary>
//   The back test provider form.
// </summary>
// --------------------------------------------------------------------------------------------------------------------


using System;
using System.Windows.Forms;

namespace Systemathics.Providers
{
    public partial class BackTestProviderForm : Form
    {
        public BackTestProviderForm()
        {
            InitializeComponent();
        }

        private void BackTestPeriod_Load(object sender, EventArgs e)
        {
            DateTime? StartDate = null, EndDate = null;
            BackTestProvider.GetMinMaxDatesDB(ref StartDate, ref EndDate);

            if (StartDate != null && EndDate != null)
            {
                FromdateTimePicker.MinDate = ((DateTime) StartDate).Date;
                FromdateTimePicker.MaxDate = ((DateTime) EndDate).Date;
                FromdateTimePicker.Value = ((DateTime) StartDate).Date;
                TodateTimePicker.MinDate = ((DateTime) StartDate).Date;
                TodateTimePicker.MaxDate = ((DateTime) EndDate).Date;
                TodateTimePicker.Value = ((DateTime) EndDate).Date;
            }
            else
            {
                Close();
            }
        }
    }
}